// Fill out your copyright notice in the Description page of Project Settings.


#include "Ability/MeleeAttackeGameplayAbility.h"

UMeleeAttackeGameplayAbility::UMeleeAttackeGameplayAbility()
{
	// load the class
	AttackMontageToPlay = LoadObject<UAnimMontage>(NULL, TEXT( "AnimMontage'/Game/Animations/GirlAnsRes/Montage/Combo_Attack_Wave_05_All_Seq1_Montage.Combo_Attack_Wave_05_All_Seq1_Montage'"));

	CooldownGameplayEffectClass = LoadObject<UClass>(NULL,TEXT("Class'/Game/Blueprints/Ability/MeleeAttack/MeleeAttacCooldown.MeleeAttacCooldown_C'"));
}

void UMeleeAttackeGameplayAbility::ActivateAbility(const FGameplayAbilitySpecHandle Handle,
                                                   const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo ActivationInfo,
                                                   const FGameplayEventData* TriggerEventData)
{
	CommitAbility(Handle,ActorInfo,ActivationInfo);
	Super::ActivateAbility(Handle, ActorInfo, ActivationInfo, TriggerEventData);
	UE_LOG(LogTemp, Log, TEXT("能力激活"));
	UAbilityTask_PlayMontageAndWait* InWait = PlayMontage(AttackMontageToPlay);
	InWait->Activate();
}
